import React, { Component } from 'react'
import { Switch, Route } from 'react-router-dom'
import Son1 from './Son1'
import Son2 from './Son2'
import Son3 from './Son3'

export default class Father extends Component {
  render() {
    return (
      <div>
        <h1>注意：1. 父组件的路由不要加exact 2. 子组件的地址要写完整</h1>
        <div>我是父组件，我包含了三个子组件，他们切换显示</div>
        <div>以下是子组件：</div>
        <Switch>
          <Route path="/father/son1" component={Son1}></Route>
          <Route path="/father/son2" component={Son2}></Route>
          <Route path="/father/son3" component={Son3}></Route>
        </Switch>
      </div>
    )
  }
}
